package com.atguigu.common;

/**
 * 基于ThreadLocal封装工具类，用户保存和获取当前登录用户id
 */
public class MyBaseContext {
    private static ThreadLocal threadLocal=new ThreadLocal();

    /**
     * 设置值
     * @param t
     */
    public static void set(Object t){
        threadLocal.set(t);
    }

    /**
     * 获取值
     * @return
     */
    public static Object get(){
       return threadLocal.get();
    }
}
